home *** CD-ROM | disk | FTP | other *** search
/ Eagles Nest BBS 1 / Eagles_Nest_Mac_Collection_Disc_1.TOAST / HyperCard & XCMD⁄XFCN / HamTechTest4 / Technician Ham Test / background_2725.txt < prev    next >
Text File  |  1993-04-11  |  7KB  |  229 lines

  1. -- background: 2725 from stack: in
  2. -- bmap block id: 3199
  3. -- flags: 4000
  4. -- background id: 0
  5. -- name: intro
  6. ----- HyperTalk script -----
  7. on buildList -- ‚Ä¢‚Ä¢‚Ä¢ rename to buildList1 if using sequential questions
  8.   -- or to buildList if using randomly-generated questions
  9.   global questlist,rightone,lockkey,questans,questkey
  10.   global sky1, sky2, sky3, sky4, sky5, sky6 -- used for saved ans key
  11.   -- initialization
  12.   set the cursor to 4
  13.   -- ‚Ä¢‚Ä¢‚Ä¢questgrp contains the number of questions in each question group
  14.   -- and is used to generate random questions, one from each group.
  15.   -- Note that the question groups MUST BE sequential in order for this
  16.   -- to work.  That is, group 1 must be the first 10 questions, group 2
  17.   -- must be the next 14 questions, and so on.
  18.   put "11,11,11,11,11,18,11,12,11,11," into questgrp
  19.   put "11,15,11,11,16,11,11,11,14,11," after questgrp
  20.   put "11,11,11,11,11" after questgrp
  21.   -- ‚Ä¢‚Ä¢‚Ä¢ The number of commas in questans and questkey must be equal to
  22.   -- number of questions in each test minus one.  For example, for a
  23.   -- 30-question test, there are 29 commas.
  24.   put ",,,,,,,,,,,,,,,,,,,,,,,," into questans
  25.   put ",,,,,,,,,,,,,,,,,,,,,,,," into questkey
  26.   put empty into questlist
  27.   put 0 into startgroup
  28.   put empty into sky1
  29.   put empty into sky2
  30.   put empty into sky3
  31.   put empty into sky4
  32.   put empty into sky5
  33.   put empty into sky6
  34.   set lockscreen to true
  35.   -- generate the questions from subgroups randomly
  36.   repeat with i = 1 to number of items of questgrp
  37.     put startgroup into thisquest
  38.     add the random of item i of questgrp to thisquest
  39.     put questlist & "#" & thisquest & "," into questlist
  40.     add item i of questgrp to startgroup
  41.   end repeat
  42.   delete last character of questlist
  43.   -- ‚Ä¢‚Ä¢‚Ä¢ generate the answer key for these questions.  this currently
  44.   -- only handles up to first 51 questions.
  45.   repeat with i = 1 to number of items of questlist
  46.     if i > 51 then exit repeat
  47.     put item i of questlist into thisquest
  48.     go to card thisquest
  49.     -- ‚Ä¢‚Ä¢‚Ä¢ You can put the card # or the subelement #  or question # -- as question #in key
  50.     put "#" & i into x -- question # option
  51.     -- put the short name of this card into x -- card # option
  52.     -- put first word of field "Q1" into x -- subelement # option
  53.     put first word of field "Q1" into y -- used for answer key
  54.     if i < 18 then
  55.       put sky1&x&"("&y&")"&return into sky1
  56.       put sky2&rightone&return into sky2
  57.     else if i < 35 then
  58.       put sky3&x&"("&y&")"&return into sky3
  59.       put sky4&rightone&return into sky4
  60.     else
  61.       put sky5&x&"("&y&")"&return into sky5
  62.       put sky6&rightone&return into sky6
  63.     end if
  64.   end repeat
  65.   go to card savedscores
  66.   put sky1 into field key1
  67.   put sky2 into field key2
  68.   put sky3 into field key3
  69.   put sky4 into field key4
  70.   put sky5 into field key5
  71.   put sky6 into field key6
  72.   -- prevent buildList from being called again immediately
  73.   put true into lockkey
  74.   go to first card
  75.   set lockscreen to false
  76. end buildList
  77.  
  78. on buildList1 -- ‚Ä¢‚Ä¢‚Ä¢ rename to buildList for sequential questions or to
  79.   -- buildList1 for randomly-generated questions
  80.   global questlist,rightone,lockkey,questans,questkey
  81.   global sky1, sky2, sky3, sky4, sky5, sky6 -- used for saved ans key
  82.   -- initialization
  83.   set the cursor to 4
  84.   -- ‚Ä¢‚Ä¢‚Ä¢ be sure that the group number of each question card matches the
  85.   -- question number.  For example, question #1 is group 1, question
  86.   -- #2 is group 2, and so on.
  87.   put empty into questlist
  88.   put empty into questans
  89.   put empty into questkey
  90.   put empty into sky1
  91.   put empty into sky2
  92.   put empty into sky3
  93.   put empty into sky4
  94.   put empty into sky5
  95.   put empty into sky6
  96.   set lockscreen to true
  97.   repeat with i = 1 to number of cards of bkgnd Test
  98.     put "#" & i & "," after questlist
  99.     put "," after questans
  100.     put "," after questkey
  101.   end repeat
  102.   delete last character of questlist
  103.   delete last character of questans
  104.   delete last character of questkey
  105.   -- ‚Ä¢‚Ä¢‚Ä¢ generate the answer key for these questions.  This currently
  106.   -- only works for first 32 questions
  107.   repeat with i = 1 to number of items of questlist
  108.     if i > 51 then exit repeat
  109.     put item i of questlist into thisquest
  110.     go to card thisquest
  111.     -- ‚Ä¢‚Ä¢‚Ä¢ You can put the card # or the subelement #  or question # -- as question #in key
  112.     -- put "#" & i into x -- question # option
  113.     put the short name of this card into x -- card # option
  114.     -- put first word of field "Q1" into x -- subelement # option
  115.     put first word of field "Q1" into y -- used for answer key
  116.     if i < 18 then
  117.       put sky1&x&"("&y&")"&return into sky1
  118.       put sky2&rightone&return into sky2
  119.     else if i < 35 then
  120.       put sky3&x&"("&y&")"&return into sky3
  121.       put sky4&rightone&return into sky4
  122.     else
  123.       put sky5&x&"("&y&")"&return into sky5
  124.       put sky6&rightone&return into sky6
  125.     end if
  126.   end repeat
  127.   go to card savedscores
  128.   put sky1 into field key1
  129.   put sky2 into field key2
  130.   put sky3 into field key3
  131.   put sky4 into field key4
  132.   put sky5 into field key5
  133.   put sky6 into field key6
  134.   -- prevent buildList from being called again immediately
  135.   put true into lockkey
  136.   go to first card
  137.   set lockscreen to false
  138. end buildList1
  139.  
  140.  
  141.  
  142. -- part 1 (button)
  143. -- low flags: 00
  144. -- high flags: 0000
  145. -- rect: left=111 top=169 right=309 bottom=228
  146. -- title width / last selected line: 0
  147. -- icon id / first selected line: 0 / 0
  148. -- text alignment: 1
  149. -- font id: 0
  150. -- text size: 12
  151. -- style flags: 0
  152. -- line height: 16
  153. -- part name: Exam
  154. ----- HyperTalk script -----
  155. on mouseDown
  156.   ask "Please enter your name."
  157.   put it into field "user" of card report
  158.   -- ‚Ä¢‚Ä¢‚Ä¢ change unlimited to # minutes to put a time limit on test
  159.   -- be sure to change background of questions and below also.
  160.   answer "You have unlimited minutes to take this test" with "OK"
  161. end mouseDown
  162.  
  163. on mouseUp
  164.   global time1,score,check2,ok,questlist
  165.   set the cursor to 4
  166.   put empty into ok
  167.   put empty into score
  168.   put empty into check2
  169.   put empty into field QMissed of card report
  170.   get the long time
  171.   put it into field "Start" of Card "Report"
  172.   convert it to seconds
  173.   -- ‚Ä¢‚Ä¢‚Ä¢ change 30 in next line to # of minutes desired for time limit
  174.   add 30*60 to it
  175.   put it into time1
  176.   -- put questlist into message -- for debug only
  177.   visual effect dissolve to black
  178.   visual effect dissolve
  179.   -- go card "#1" -- for debug only
  180.   get item 1 of questlist
  181.   go card it
  182. end mouseUp
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190. -- part 2 (button)
  191. -- low flags: 00
  192. -- high flags: 0000
  193. -- rect: left=27 top=47 right=85 bottom=71
  194. -- title width / last selected line: 0
  195. -- icon id / first selected line: 1011 / 1011
  196. -- text alignment: 1
  197. -- font id: 0
  198. -- text size: 12
  199. -- style flags: 0
  200. -- line height: 16
  201. -- part name: Home
  202. ----- HyperTalk script -----
  203. on mouseUp
  204.   visual effect iris close
  205.   go home
  206. end mouseUp
  207.  
  208.  
  209.  
  210.  
  211. -- part 4 (button)
  212. -- low flags: 00
  213. -- high flags: 0000
  214. -- rect: left=431 top=55 right=94 bottom=472
  215. -- title width / last selected line: 0
  216. -- icon id / first selected line: 14767 / 14767
  217. -- text alignment: 1
  218. -- font id: 0
  219. -- text size: 12
  220. -- style flags: 0
  221. -- line height: 16
  222. -- part name: Tell Me About...
  223. ----- HyperTalk script -----
  224. on mouseUp
  225.   push this card
  226.   visual effect iris open
  227.   go to card "About...."
  228. end mouseUp
  229.